package jmind.core.test;

import java.io.File;

public class CurrentDirectory {

    public static void main(String[] args) throws Exception {
        System.out.println(Thread.currentThread().getContextClassLoader().getResource(""));
        System.out.println(CurrentDirectory.class.getClassLoader().getResource(""));
        System.out.println(ClassLoader.getSystemResource(""));
        System.out.println(CurrentDirectory.class.getResource(""));
        System.out.println(CurrentDirectory.class.getResource("/").getPath());
        System.out.println(new File("").getAbsolutePath());

        //获取当前类文件所在包的根目录
        System.out.println(System.getProperty("user.dir"));
        //获取当前类文件所在的目录 
        System.out.println(CurrentDirectory.class.getResource("").getPath().replace("%20", " "));
    }
}
